package Application.controller;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import Application.entity.Attention;
import Application.entity.Result;
import Application.service.AttentionService;

@CrossOrigin	
@RestController
@RequestMapping("/Attention")
public class AttentionControl {

	@Resource
	private AttentionService service;
	
	@PostMapping("/addAttention")
	public Result  addAttention(Attention attention) {
		return service.addAttention(attention);
	}
	
	
	@PostMapping("/removeAttention")
	public Result removeAttention(int id) {
		return service.removeAttention(id);
	}
	
	@PostMapping("/findUserAttention")
	public List<Attention>  findUserAttention(int id){
	return service.findUserAttention(id);
	}
	
	
}
